Library Blazor Components NextGrid Articles Quick Start 2.Connecting the data

2.Connecting the data

Data is provided by ItemsSource parameter. Data need to be contained of items of type specified by T type parameter.

razor
<NextGrid T=“Product” ItemsSource=“Products” />

After a list is connected to the grid, it is necessary to tell what a column will render in its cells. This is done via DataBinding parameter as could be seen on a previous page.

This parameter of Func type will provide item currently being rendered and developer can chose which property of item will use.

Example

razor
<SpinColumn HeaderText="Price" DataBinding="p => p.Price" />
<SpinColumn HeaderText="Price" DataBinding="p => GetFormattedPrice(p.Price)" />

Next: 3. Fine adjustments

Sign in